home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CinE CD 6
/
CinE CD ROM 06.iso
/
mac
/
Shared.Cst
/
00090_Script_90
< prev
next >
Wrap
Text File
|
1996-06-22
|
14KB
|
545 lines
global gQuickTimeToPlay
global gNumFilms, gmode, gnumpreviews, scrolledN
global gPage, gFilmsPerPage, gnumpages, gFilmIndex, gscale, gvideoflag
global database, errordatabase, fieldNames, grootpathname, gmachine, gseparator, gQTpresent
global glastmovie, DEBUG, gautomode, gcannes, rWindow, gsoundEnabled, gwin, grect, gsoundlevel
on makeDatabase castNum
-- initialize the lists
set the itemDelimiter= ";" -- could be something else, like a TAB
put [:] into database
sort database -- better performance
put [:] into record
put [] into fieldNames
-- get the data and field header structure
put field castNum into rawData
put the number of items in line 1 of rawData into fieldCount
-- put the fieldnames into a variable
put line 1 of rawData into rawFields
-- remove the field names from the data
delete line 1 of rawData
-- store the field names into a linear list
repeat with n = 1 to fieldCount
add fieldNames, value ("#" & item n of rawFields)
end repeat
-- store the number of records
put the number of lines in rawData into recordCount
put "recordCount=" recordcount
put recordCount into gNumFilms
-- process the lines of data into records
repeat with r = 1 to recordCount
put line r of rawData into dataLine
repeat with f = 1 to fieldCount
-- get each field of data
put item f of dataLine into dataItem
-- store the field as part of a record
addProp record, getAt(fieldNames, f), dataItem
end repeat
-- add the record to the database, r = the original record number
addProp database, record, r
put [:] into record -- reset the record holder
end repeat
--determine and set the number of index pages
set gnumpages = gnumfilms / gfilmsperpage
if (gnumfilms mod gfilmsperpage) then
set gnumpages = gnumpages + 1
end if
--films that do not have data (previews of next month's films do not count)
set k = gnumfilms
repeat with i = 1 to k
if (getField (i, 9) = "0") then
put "no data, record=" k
put getField (i, 2)
set gnumfilms = gnumfilms - 1
end if
end repeat
set gnumpreviews = k - gnumfilms
-- show the records : debugging
--repeat with r = 1 to recordCount
--put getOne(database, r)
--end repeat
end makeDatabase
on getRecord recordNum
return getone(database, recordNum)
end getRecord
on getField recordNum, fieldNum
return getProp(getone(database, recordNum), getAt(fieldNames, fieldNum))
end getField
on findRecord fieldNum, criteria
put count(database) into recordCount
repeat with recordNum = 1 to recordCount
put getProp(getone(database, recordNum), getAt(fieldNames, fieldNum)) into fieldData
if fieldData = criteria then
getRecord recordNum
end if
end repeat
end findRecord
on getFieldName fieldNum
return getAt(fieldNames, fieldNum)
end getFieldName
on ReadMyPICT filename, castname
if (DEBUG) then
put filename
end if
set PICTfile = FileIO(mNew, "read", filename)
if (PICTfile < 0) then
error_handle (PICTfile, filename)
end if
if not objectp(PICTfile) then exit
--set the picture of cast castname = PICTfile(mReadPICT)
set the picture of member castname of castlib 2 = PICTfile(mReadPICT)
PICTfile(mDispose)
end ReadMyPICT
on makepathname dir, prefix, suffix
global gseparator
return grootpathname & "DATA" & gseparator & dir & gseparator & prefix & suffix
end makepathname
on displayposters
cursor 4
put (gPage - 1) * gFilmsPerPage + 1 into start
put start + gFilmsPerPage - 1 into stop
set num = gnumpreviews + gnumfilms
if (stop > num) then
put num into stop
end if
-- set mypathname = makepathname ("", "dummy", "A0.PIC")
set mypathname = makepathname ("", "dummy", "A1.PIC")
set j = 0
repeat with i = start to stop
set dir = getField (i, 3)
set prefix = getField (i, 4)
--set mypathname = makepathname (dir, prefix, "A0.PIC")
set mypathname = makepathname (dir, prefix, "A1.PIC")
set k = the number of member "DUMMY A1.PIC" of castlib 2
set k = 16
readmypict (mypathname, k+j)
put j+1 into j
set the text of cast "pagenum" = string(gpage)
end repeat
cursor 0
end displayposters
on displayfilm index
global ggenres
cursor 4
if (getField (index, 8) = "0") then
return
end if
debug_message ("displayfilm index=", index)
if index > gNumFilms then
put gNumFilms into index
end if
if index < 1 then
put 1 into index
put 1 into gnumFilms
end if
if (DEBUG) then
put index
end if
set dir = getField (index, 3)
set prefix = getField (index, 4)
set mypathname = makepathname (dir, prefix, "A1.PIC")
readmypict (mypathname, 1)
set mypathname = makepathname (dir, prefix, "P1.PIC")
readmypict (mypathname, 2)
set mypathname = makepathname (dir, prefix, "P2.PIC")
readmypict (mypathname, 3)
set mypathname = makepathname (dir, prefix, "P3.PIC")
readmypict (mypathname, 5)
--caption 1
set the text of cast "text1" to getField (index, 5)
--caption 2
set tmp1 = getField (index, 12)
set tmp2 = getField (index, 13)
set the text of cast "text2" to tmp1 & RETURN & RETURN & tmp2
set the text of cast "copyright" to getField (index, 8)
set tmppath = grootpathname & "MISC" & gseparator & "G" & getField (gFilmindex, 9) & ".PIC"
readmypict (tmppath, "genre")
updatestage
cursor 0
end displayfilm
on PlayQuickTime index
global gscale, grect
if index > gNumFilms then
put gNumFilms into index
end if
if index < 1 then
put 1 into index
end if
set dir = getField (index, 3)
set prefix = getField (index, 4)
set mypathname = makepathname (dir, prefix, "V1.MOV")
set gQuickTimeToPlay = mypathname
set the windowlist = []
set the windowtype of window "PLAYQT" = 4
set gwin = getat (the windowlist, 1)
set the title of gwin = getField (index, 2)
set the titlevisible of gwin = TRUE
set the modal of gwin = TRUE
set w = value (getField (index, 10))
set h = value (getField (index, 11))
set grect = rect(0, 0, w, h)
save_rects ()
-- set w = value (getField (index, 10)) * gscale
-- set h = value (getField (index, 11)) * gscale
set w = w * gscale
set h = h * gscale
put ((the StageRight - the StageLeft) - w) / 2 + the stageleft into windowH
put ((the StageBottom - the StageTop) - h) / 2 + the StageTop into windowV
set r = rect (windowH, windowV, windowH + w, windowV + h)
set the rect of gwin = r
open gwin
movetofront gwin
end PlayQuickTime
on PlayQuickTime_file fname, the_title
global gscale, grect, gseparator
set mypathname = grootpathname & "MISC" & gseparator & fname
put gseparator
put mypathname
set gQuickTimeToPlay = mypathname
set the windowlist = []
set the windowtype of window "PLAYQT" = 4
set gwin = getat (the windowlist, 1)
set the title of gwin = the_title
set the titlevisible of gwin = TRUE
set the modal of gwin = TRUE
-- set w = value (getField (index, 10))
-- set h = value (getField (index, 11))
set w = 309
set h = 168
set grect = rect(0, 0, w, h)
save_rects ()
-- set w = value (getField (index, 10)) * gscale
-- set h = value (getField (index, 11)) * gscale
set w = w * gscale
set h = h * gscale
put ((the StageRight - the StageLeft) - w) / 2 + the stageleft into windowH
put ((the StageBottom - the StageTop) - h) / 2 + the StageTop into windowV
set r = rect (windowH, windowV, windowH + w, windowV + h)
set the rect of gwin = r
open gwin
movetofront gwin
end PlayQuickTime_file
on filmselection spritenum, n, y, start
cursor 4
set dy = 21
set space_between_buttons = 9
--set DEBUG = TRUE
if n = 1 then
set gfilmindex = start + 1
else
set y = y + dy + space_between_buttons/2
set gfilmindex = ((y - the top of sprite spritenum) / dy ) + start
end if
set the movierate of sprite 21 = 0
if (DEBUG) then
put gfilmindex
return
end if
-- If there is no artwork associated with the film then just return
if (getField (gFilmIndex, 8) = "0") then
return
else
--puppetsound "click"
--updatestage
end if
-- Store the Director movie to go back to
put "MAIN.DIR" into glastmovie
debug_message ("index", gfilmindex)
displayfilm (gfilmindex)
cursor 0
go to frame "film"
end filmselection
on debug_message message, val
if (DEBUG) then
set str = "DEBUG: {"&message & ":" & val &"}"
put str
end if
end debug_message
on error_handle error_result, filename
if (error_result < 0) then
--alert ("Erreur: [" & error_result & ":" & filename & "]")
put "Erreur: [" & error_result & ":" & filename & "]"
end if
end error_handle
on poster_select num
puppetsound "click"
updatestage
put (gPage - 1) * gFilmsPerPage + num - 1 into gFilmIndex
if (getField (gFilmIndex, 9) = "0") then
return
end if
set glastmovie = "POSTERS.DIR"
working (num)
displayfilm (gfilmindex)
go to frame "film"
end
on button_script
--puppetsprite 1, true
--puppetsound "click"
--updatestage
set ic = (the castnum of sprite the clickon)
--repeat while the stilldown
set the castnum of sprite the clickon = the castnum of sprite the clickon + rollover ( the clickon)
updatestage
set the castnum of sprite the clickon = ic
--end repeat
puppetsound "click"
updatestage
if rollover (the clickon) = 0 then exit
end button_script
on hideDesktop
global rWindow
if objectP (rWindow) then rWindow (mDispose)
put RearWindow (mNew, "M") into rWindow
put value (rWindow ) into resultCode
if (resultCode < 0) then
alert "A" && string (resultCode) && "error occurred while trying to hide the desktop."
end if
end hideDesktop
on handlekey
global gsoundEnabled
if the key = "-" then
set gsoundEnabled = not gsoundEnabled
set the soundEnabled = gsoundEnabled
end if
dontPassEvent
end handlekey
on handcursor spritenum
set hand = the number of cast "hand"
set handmask = the number of cast "handmask"
set the cursor of sprite spritenum = [hand, handmask]
end handcursor
on normal_cursor spritenum
cursor -1
end handcursor
on watch_cursor spritenum
cursor 4
end handcursor
on reset_cursors
normal_cursor
repeat with i = 1 to 20
set the cursor of sprite i = 0
end repeat
end reset_cursors
on to_script
-- if there is already a movie playing then don't do anything
if (count (the windowlist) <> 0) then
return
end if
if (gmode = "auto") then
repeat with i = 1 to 2
set the castNum of sprite 12 = the castnum of sprite (13 + i)
set the text of cast "text1" to getField (gfilmindex, 5 + i)
updatestage
countTime (2)
end repeat
countTime (2)
if gQTpresent then
set gscale = 1
PlayQuickTime gFilmIndex
end if
end if
set the timeoutScript to EMPTY
end to_script
on to_script2
-- if there is already a movie playing then don't do anything
if (count (the windowlist) <> 0) then
return
end if
if (gmode = "auto") then
puppetsprite 11, FALSE
puppetsprite 12, FALSE
go to frame "black"
end if
set the timeoutScript to EMPTY
end to_script
on countTIme secs
starttimer
repeat while the timer < (secs * 60)
nothing
end repeat
end countTime
on list_films
global gnumfilms
set saver = FileIO(mNew, "?write", "Titles")
if (saver < 0) then
return
end if
if not objectp(saver) then
alert ("fsave: error")
exit
end if
saver (mSetFinderInfo, "TEXT", "ttxt")
repeat with i = 1 to gnumfilms
set tmp = getfield (i, 2)
if (i < gnumfilms) then
set tmp = tmp & RETURN
end if
saver(mWriteString, tmp)
end repeat
saver(mDispose)
end
on make_eps
global gnumfilms
set saver = FileIO(mNew, "?write", "Titles.eps")
if (saver < 0) then
return
end if
if not objectp(saver) then
alert ("fsave: error")
exit
end if
saver (mSetFinderInfo, "TEXT", "ttxt")
saver (mWriteString, "%!PS-Adobe-2.0 EPSF-1.2" & RETURN)
set texth = 18
set spacing = 4
set mx = 12
set h = (texth * gnumfilms) + (spacing * gnumfilms)
saver (mWriteString, "%%BoundingBox: 0 0 400 " & h & RETURN & RETURN)
saver (mWriteString, the text of cast "Postscript" & RETURN)
set y = 3
repeat with i = gnumfilms down to 1
set y = y + spacing/2
set tmp = string (mx) & " " & string (y) & " moveto" & RETURN
saver (mWriteString, tmp)
set tmp = getfield (i, 2)
set tmp = "(" & "ò " & tmp & ")" & " show" & RETURN
saver (mWriteString, tmp)
set y = y + texth + spacing/2
set tmp = string (mx) & " " & string (y) & " moveto" & RETURN
saver (mWriteString, tmp)
end repeat
saver (mWriteString, "showpage" & RETURN)
saver(mDispose)
end
on ascii
repeat with i = 0 to 255
set d2 = i/64
set d1= (i-(d2*64))/8
set d0= (i-((d2*64)+(d1*8)))
put i, d2, d1, d0, numtochar (i)
end repeat
end ascii